package com.lantosec.hmrp.modules.category.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.category.entity.AssetsDirectory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 资产目录 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="AssetsDirectory对象", description="资产目录")
public class AssetsDirectoryVO extends BaseVO<AssetsDirectory> {
    private static final long serialVersionUID = 1L;


    public AssetsDirectoryVO(AssetsDirectory entity){
        this.dirId = entity.getDirId();
        this.assetsName = entity.getAssetsName();
        this.categoryId = entity.getCategoryId();
        this.lableType = entity.getLableType();
        this.manualFlag = entity.getManualFlag();
        this.specification = entity.getSpecification();
        this.unit = entity.getUnit();
        this.price = entity.getPrice();
        this.supplierCode = entity.getSupplierCode();
        this.supplier = entity.getSupplier();
        this.factoryCode = entity.getFactoryCode();
        this.factory = entity.getFactory();
        this.createTime = entity.getCreateTime();
        this.createUserId = entity.getCreateUserId();
        this.createUser = entity.getCreateUser();
        this.editorTime = entity.getEditorTime();
        this.editorUserId = entity.getEditorUserId();
        this.editorUser = entity.getEditorUser();
        this.categoryName = entity.getCategoryName();
    }

    @Override
    public AssetsDirectory convertToEntity(){
        return new AssetsDirectory(this);
    }


    @ApiModelProperty(value = "目录ID(his目录直接取，手工录入格式：LTxxxx)")
    private String dirId;

    @ApiModelProperty(value = "资产名称")
    private String assetsName;

    @ApiModelProperty(value = "资产类别")
    private String categoryId;

    @ApiModelProperty(value = "资产类别名称")
    @TableField(exist = false)
    private String categoryName;

    @ApiModelProperty(value = "标签材质(0无标签 1普通RFID 2抗金属RFID)")
    private Integer lableType;

    @ApiModelProperty(value = "是否手工录入(0 否,来自his目录；1 是)")
    private Integer manualFlag;

    @ApiModelProperty(value = "规格型号")
    private String specification;

    @ApiModelProperty(value = "计量单位")
    private String unit;

    @ApiModelProperty(value = "资产原价(购买价格)")
    private BigDecimal price;

    @ApiModelProperty(value = "供应商编码")
    private String supplierCode;

    @ApiModelProperty(value = "供应商名称")
    private String supplier;

    @ApiModelProperty(value = "生产厂家编码")
    private String factoryCode;

    @ApiModelProperty(value = "生产厂家名称")
    private String factory;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "创建人ID")
    private String createUserId;

    @ApiModelProperty(value = "创建人")
    private String createUser;

    @ApiModelProperty(value = "最后编辑时间")
    private Date editorTime;

    @ApiModelProperty(value = "最后编辑人ID")
    private String editorUserId;

    @ApiModelProperty(value = "最后编辑人")
    private String editorUser;


}
